<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!--潘天赐-->
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript" src="static/js/jquery.min.js"></script>
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap-treeview.min.css"
          th:href="@{static/js/bootstrap/css/bootstrap-treeview.min.css}"
    >
    <script src="static/js/bootstrap/js/bootstrap-treeview.min.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap.addtabs.css">
    <script src="static/js/bootstrap/js/bootstrap.addtabs.min.js"></script>
    <link rel="stylesheet" href="static//js/bootstrap/css/bootstrap-table.min.css">
    <script src="static/js/bootstrap/js/bootstrap-table.min.js"></script>
    <script src="static/js/bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="static/js/bootstrap/js/bootbox.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="static/js/bootstrap-fileinput/js/fileinput.js"></script>
    <script src="static/js/bootstrap-fileinput/js/locales/zh.js"></script>
    <link rel="stylesheet" href="static/js/bootstrap-fileinput/css/fileinput.css">

</head>
<body>
&nbsp;
<button type="button" onclick="exportData()" style="width: 200px" class="btn btn-success">下载</button>
<br><br>
<h4 style="color: #8c8c8c"><label>材料单名称： [[${session.queryMyMaterialsName}]]</label></h4><br>
<h4>材料单的各部件详细配置：</h4>
<table id="myTable"></table>

</body>
<script>
    //var id = [[${session.queryPriceId}]]
    $("#myTable").bootstrapTable({
        url:"queryMyMaterials",
        columns:[
            {field:'materialsType',title:'类目',
                formatter: function(value,row,index){
                    return '<input type="hidden" id="materialsInventoryId" value="'+row.materialsInventoryId+'" class="form-control" style="width:50px;">'+value
                }
            },
            {field:'materialsName',title:'材料名称'},
            {field:'materialsId',title:'材料编码'},
            {field:'materialsCount',title:'材料数量'},
        ],
        pagination:true,			//是否展示分页
        pageNumber:1,				//当前页
        pageList:[1,3,5],			//分页组件
        sidePagination : 'client',	//分页方式：client客户端分页，server服务端分页
    })


    //导出
    function exportData(){
        var id = $("#materialsInventoryId").val()
        alert("下载成功")
        location.href="exportData?id="+id;
    }


</script>
</html>